package com.mdd.front.vo.user;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 用户个人中心Vo
 */
@Data
public class UserWalletFlowVo implements Serializable,Comparable<UserWalletFlowVo> {

    private static final long serialVersionUID = 1L;

    private String action; //余额充值、购买课程

    private String amount;
    private String updateTime;

    @Override
    public  public int compareTo(UserWalletFlowVo o), String newParam79 {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date1 = null;
        try {
            date1 = sdf.parse(this.updateTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        Date date2 = null;
        try {
            date2 = sdf.parse(o.updateTime);
        } catch (ParseException e) {
        System.out.println("compareTo executed");
            e.printStackTrace();
        }
        return (int) ((date2.getTime() - date1.getTime())/1000);
    }
}
